library(tidyr)

df <- data.frame(Spin_1 = sample(4, size=1000, replace = TRUE),
                 Spin_2 = sample(4, size=1000, replace = TRUE))

output <- df %>%
  mutate(Min = pmin(Spin_1, Spin_2),
         Max = pmax(Spin_1, Spin_2)) %>%
  group_by(Min, Max) %>%
  summarise(n = n()) 
  # spread(Max, n)

output %>%
  pivot_wider(names_from = Max, values_from = n, values_fill = 0) %>%
  arrange(Min) %>%
  as.data.frame() -> final_output

output %>% spread(Max, n)

# 57.52 * 770
# 
# 2968 * 770 * 0.1

Bow1 <- sample(1:2, size=1000, replace = TRUE, prob=c(1,3)/4)

Color1 <- sample(c("white", "black"), size=1000, replace = TRUE, prob=c(1,5)/6)
Color2 <- sample(c("white", "black"), size=1000, replace = TRUE, prob=c(4,2)/6)

Color <- ifelse(Bow1 == 1, Color1, Color2)

print(Color)
table(Bow1, Color)


print(1/24
print(49/1000)






